home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / bash / bash-110 / unixmo~1 / 110src~1.zoo / patches.zoo / src / Makefile.cross < prev    next >
Encoding:
Makefile  |  1991-10-30  |  8.5 KB  |  253 lines

  1.  
  2. # We would like you to use Bison instead of Yacc since some
  3. # versions of Yacc cannot handle reentrant parsing.  Unfortunately,
  4. # this includes the Yacc currently being shipped with SunOS4.x.
  5. # If you do use Yacc, please make sure that any bugs in parsing
  6. # are not really manifestations of Yacc bugs before you report
  7. # them.
  8.  
  9. # Can be overidden on invocation.
  10. MAKE = make -f Makefile.cross
  11. DESTDIR = .
  12.  
  13. # Here is a rule for making .o files from .c files that does not
  14. # force the type of the machine (like -"sparc") into the flags.
  15. .c.o:
  16.     $(RM) $@
  17.     $(CC) -c -o $*.o $(CFLAGS) $(CPPFLAGS) $*.c
  18.  
  19. BISON = bison -y
  20. CC = cgcc
  21.  
  22. # Of course, you cannot do this the first time through...
  23. SHELL=bash
  24.  
  25. RM = rm -f
  26. AR = car
  27. MACHINE = "atari"
  28. OS = TOS
  29.  
  30. # PROFILE_FLAGS is either -pg, to generate profiling info for use
  31. # with gprof, or nothing (the default).
  32. PROFILE_FLAGS=
  33.  
  34.  
  35. # This system has some peculiar flags that must be passed to the
  36. # the C compiler (or to cpp).
  37. # SYSDEP = -DBSD_GETPGRP
  38.  
  39. # This system has the setlinebuf () call.
  40. # LINEBUF = -DHAVE_SETLINEBUF
  41.  
  42. # This system has the vprintf () and vfprintf () calls.
  43. VPRINTF = -DHAVE_VPRINTF
  44.  
  45. # This system has <unistd.h>.
  46. UNISTD = -DHAVE_UNISTD_H
  47.  
  48. # This system has multiple groups.
  49. # GROUPS = -DHAVE_MULTIPLE_GROUPS
  50.  
  51. # This system has <sys/resource.h>
  52. RESOURCE = -DHAVE_RESOURCE
  53.  
  54. # This system's signal () call returns a pointer to a function returning
  55. # void.  The signal handlers themselves are thus void functions.
  56. SIGHANDLER = -DVOID_SIGHANDLER
  57.  
  58. # This system has <sys/wait.h>
  59. # WAITH = -DHAVE_WAIT_H
  60.  
  61. # This system has the getwd () call.
  62. # GETWD = -DHAVE_GETWD
  63.  
  64. # This system has a working version of dup2 ().
  65. DUP2 = -DHAVE_DUP2
  66.  
  67. SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
  68.        $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) $(STRERROR) \
  69.        -D$(MACHINE) -D$(OS)
  70.  
  71. DEBUG_FLAGS = $(PROFILE_FLAGS) 
  72. LDFLAGS     = $(SYSDEP_LD) $(DEBUG_FLAGS) -s  
  73.  
  74. CFLAGS        = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS) \
  75.           -O -fstrength-reduce -fomit-frame-pointer
  76.  
  77. CPPFLAGS    = -I$(LIBSRC)
  78.  
  79. LIBRARY_CFLAGS  = $(DEBUG_FLAGS) $(SIGHANDLER) $(ALLOCA_CFLAGS) \
  80.           $(SYSDEP) -D$(MACHINE) -D$(OS) $(UNISTD) -DSHELL
  81.  
  82. # These are required for sending bug reports.
  83. SYSTEM_NAME = $(MACHINE)
  84. OS_NAME = $(OS)
  85.  
  86. # The name of this program.
  87. PROGRAM = bash.ttp
  88.  
  89. # The type of machine Bash is being compiled on.
  90. HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)'
  91.  
  92. bash_maintainer = scott@sparc1.stevens-tech.edu
  93. MAINTAIN_DEFINE = -DMAINTAINER='"$(bash_maintainer)"'
  94.  
  95. # The group of configuration flags.  These are for shell.c
  96. CFG_FLAGS = -DOS_NAME='"$(OS_NAME)"' -DSYSTEM_NAME='$(SYSTEM_NAME)' \
  97.          $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
  98.  
  99. # The directory which contains the source for malloc.  The name must
  100. # end in a slash, as in "./lib/malloc/".
  101. ALLOC_DIR = ../lib/malloc/
  102.  
  103. # Our malloc.
  104. ALLOCA_H_DEFINE = -DHAVE_ALLOCA_H
  105. ALLOCA_DEFINE   = -DHAVE_ALLOCA
  106. ALLOCA_CFLAGS   = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
  107. ALLOC_HEADERS   = $(ALLOC_DIR)getpagesize.h
  108. ALLOC_FILES   = $(ALLOC_DIR)malloc.c $(ALLOC_DIR)alloca.c $(ALLOC_DIR)xmalloc.c
  109. # The location of ranlib on your system.
  110. RANLIB = car 
  111.  
  112. # Support for the libraries required.  Termcap, Glob, and Readline.
  113. # The location of sources for the support libraries.
  114. LIBSRC = ../lib/
  115.  
  116. # You wish to compile with the line editing features installed.
  117. READLINE_LIB = -lreadline
  118. TERMCAP_LIB  = -ltermcap
  119. GLOB_LIB     = -lglob
  120.  
  121. # The source and object of the bash<->readline interface code.
  122. RL_SUPPORT_SRC = bashline.c
  123. RL_SUPPORT_OBJ = bashline.o
  124.  
  125. RLIBSRC = ../lib/readline/
  126.  
  127. # The order is important.  Most dependent first.
  128. LIBRARIES = $(READLINE_LIB) $(TERMCAP_LIB) $(GLOB_LIB) $(LOCAL_LIBS)
  129.  
  130. BUILTINS_LIB = builtins/builtins.olb
  131.  
  132. # The main source code for the Bourne Again SHell.
  133. CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
  134.        dispose_cmd.c execute_cmd.c variables.c $(GLOBC) version.c \
  135.        expr.c copy_cmd.c flags.c subst.c hash.c mailcheck.c \
  136.        test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) braces.c \
  137.        unwind_prot.c siglist.c lib+/lib-plus.c $(RL_SUPPORT_SRC)
  138.  
  139. HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c y.tab.h \
  140.        general.h variables.h config.h $(ALLOC_HEADERS) alias.h maxpath.h \
  141.        quit.h machines.h posixstat.h filecntl.h unwind_prot.h
  142.  
  143. SOURCES     = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
  144.  
  145. # Matching object files.
  146. OBJECTS     = shell.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
  147.        dispose_cmd.o execute_cmd.o variables.o copy_cmd.o \
  148.        expr.o flags.o jobs.o subst.o hash.o mailcheck.o test.o \
  149.        trap.o alias.o $(MALLOC) $(ALLOCA) braces.o unwind_prot.o \
  150.        $(SIGLIST) version.o $(RL_SUPPORT_OBJ) $(BUILTINS_LIB) \
  151.            lib+/lib-plus.o
  152.  
  153. # Where the source code of the shell builtins resides.
  154. DEFDIR = builtins/
  155. BUILTIN_DEFS = $(DEFDIR)alias.def $(DEFDIR)bind.def $(DEFDIR)break.def \
  156.            $(DEFDIR)builtin.def $(DEFDIR)cd.def $(DEFDIR)colon.def \
  157.            $(DEFDIR)command.def $(DEFDIR)declare.def \
  158.            $(DEFDIR)echo.def $(DEFDIR)enable.def $(DEFDIR)eval.def \
  159.            $(DEFDIR)exec.def $(DEFDIR)exit.def $(DEFDIR)fc.def \
  160.            $(DEFDIR)fg_bg.def $(DEFDIR)hash.def $(DEFDIR)help.def \
  161.            $(DEFDIR)history.def $(DEFDIR)jobs.def $(DEFDIR)kill.def \
  162.            $(DEFDIR)let.def $(DEFDIR)read.def $(DEFDIR)return.def \
  163.            $(DEFDIR)set.def $(DEFDIR)setattr.def $(DEFDIR)shift.def \
  164.            $(DEFDIR)source.def $(DEFDIR)suspend.def $(DEFDIR)test.def \
  165.            $(DEFDIR)times.def $(DEFDIR)trap.def $(DEFDIR)type.def \
  166.            $(DEFDIR)ulimit.def $(DEFDIR)umask.def $(DEFDIR)wait.def \
  167.            $(DEFDIR)getopts.def $(DEFDIR)reserved.def
  168.  
  169. BUILTIN_C_CODE  = $(DEFDIR)mkbuiltins.c $(DEFDIR)common.c \
  170.           $(DEFDIR)hashcom.h $(GETOPT_SOURCE)
  171.  
  172. BUILTIN_SUPPORT = $(DEFDIR)Makefile.cross $(DEFDIR)ChangeLog $(PSIZE_SOURCE) \
  173.           $(BUILTIN_C_CODE)
  174.  
  175.  
  176. $(PROGRAM):  .build $(OBJECTS) $(LIBDEP)
  177.     $(RM) $@
  178.     $(CC) $(LDFLAGS) $(READLINE_LDFLAGS) $(GLOB_LDFLAGS) \
  179.        -o $(PROGRAM) $(OBJECTS) $(LIBRARIES) 
  180.  
  181. .build:    $(SOURCES)
  182.     @echo
  183.     @echo "      ***************************************************"
  184.     @echo "      *                            *"
  185.     @echo "      * Making Bash-1.10 for a $(MACHINE) running $(OS)."
  186.     @echo "      *                            *"
  187.     @echo "      ***************************************************"
  188.     @echo
  189.  
  190. y.tab.c:    parse.y shell.h
  191.         $(BISON) -d parse.y
  192.  
  193. y.tab.h:    parse.y shell.h
  194.         $(BISON) -d parse.y
  195.  
  196. version.o:    version.h version.c
  197.  
  198. shell.o:    shell.h flags.h shell.c posixstat.h filecntl.h endian.h
  199.         $(CC) $(CFG_FLAGS) $(CFLAGS) $(CPPFLAGS) -c shell.c
  200.  
  201. variables.o: shell.h hash.h flags.h variables.h variables.c
  202.     $(CC) -c $(CFLAGS) $(CPPFLAGS) $(HOSTTYPE_DECL) variables.c
  203.  
  204. builtins/builtins.olb: $(BUILTIN_DEFS) $(BUILTIN_C_CODE)
  205.     ( cd $(DEFDIR); $(MAKE) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS) '$(LIBINC_USAGE)' -I.' LDFLAGS='$(LDFLAGS)' RANLIB=$(RANLIB) AR=$(AR) CC=$(CC) DIRECTDEFINE='-D '$(DEFDIR) $(MFLAGS))
  206.  
  207. shell.h:    general.h variables.h config.h quit.h
  208. jobs.h:        endian.h quit.h
  209. variables.h:    hash.h
  210. braces.o: general.h
  211. copy_cmd.o: shell.h hash.h
  212. copy_cmd.o: general.h variables.h config.h quit.h
  213. dispose_cmd.o: shell.h
  214. dispose_cmd.o: general.h variables.h config.h quit.h
  215. execute_cmd.o: shell.h y.tab.h posixstat.h flags.h jobs.h
  216. execute_cmd.o: general.h variables.h config.h quit.h hash.h endian.h
  217. execute_cmd.o: unwind_prot.h
  218. expr.o: shell.h hash.h
  219. expr.o: general.h variables.h config.h quit.h
  220. flags.o: flags.h config.h general.h quit.h
  221. general.o: shell.h maxpath.h
  222. general.o: general.h variables.h config.h quit.h
  223. hash.o: shell.h hash.h
  224. hash.o: general.h variables.h config.h quit.h
  225. jobs.o: shell.h hash.h trap.h jobs.h
  226. jobs.o: general.h variables.h config.h endian.h quit.h
  227. mailcheck.o: posixstat.h maxpath.h variables.h
  228. mailcheck.o: hash.h quit.h
  229. make_cmd.o: shell.h flags.h
  230. make_cmd.o: general.h variables.h config.h quit.h
  231. y.tab.o: shell.h flags.h maxpath.h
  232. y.tab.o: general.h variables.h config.h quit.h
  233. print_cmd.o: shell.h y.tab.h
  234. print_cmd.o: general.h variables.h config.h quit.h
  235. shell.o: shell.h flags.h
  236. shell.o: general.h variables.h config.h quit.h
  237. subst.o: shell.h flags.h alias.h jobs.h
  238. subst.o: general.h variables.h config.h endian.h quit.h
  239. test.o: posixstat.h
  240. trap.o: trap.h shell.h hash.h unwind_prot.h
  241. trap.o: general.h variables.h config.h quit.h
  242. unwind_prot.o: config.h general.h unwind_prot.h
  243.  
  244. bashline.o: shell.h hash.h builtins.h
  245. bashline.o: general.h variables.h config.h quit.h alias.h
  246.  
  247. bashline.o: $(RLIBSRC)chardefs.h $(RLIBSRC)history.h $(RLIBSRC)readline.h
  248. bashline.o: $(RLIBSRC)keymaps.h $(RLIBSRC)history.h
  249. y.tab.o: $(RLIBSRC)keymaps.h $(RLIBSRC)chardefs.h $(RLIBSRC)history.h
  250. y.tab.o: $(RLIBSRC)readline.h
  251. subst.o: $(RLIBSRC)history.h
  252.  
  253.